package com.study.annotation.demo.controller;

import cn.hutool.core.util.DesensitizedUtil;
import com.study.annotation.demo.Sensitive2;
import com.study.annotation.demo.dto.UserDTO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WebController {
//2.0
  /*  @Autowired
    private Service service;*/

    @GetMapping(value = "/index")
    public UserDTO fun(){
        UserDTO userDTO = new UserDTO();
        userDTO.setMobile("23234");
       // fun2();
      //  service.fun1();
        return userDTO;
    }

    @Sensitive2(desensitizedType = DesensitizedUtil.DesensitizedType.MOBILE_PHONE)
    private void fun2(){
        System.out.println("fun2");
    }


}
